package com.jy.service.impl;

import com.jy.dao.Product_releaseDao;
import com.jy.model.Account;
import com.jy.model.Product_release;
import com.jy.model.WithdrawalRecord;
import com.jy.service.Product_releaseService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * 
 * 产品发布管理 实现类
 * @author hgl
 * 
 * */
@Component
public class Product_releaseServiceImpl implements Product_releaseService{
	@Resource
	private Product_releaseDao productDao;
	public List<Product_release> getInvestInfo(Integer rows, Integer page,
			String product_name,String syl,String [] ids) {
		// TODO Auto-generated method stub
		return productDao.getInvestInfo(rows, page, product_name,syl,ids);
	}
	public int getInvestCount(String product_name,String syl) {
		// TODO Auto-generated method stub
		return productDao.getInvestCount(product_name,syl);
	}
	public int saveInvest(Account a) {
		Product_release release=productDao.getProductId(a.getProduct_id());
		a.setInvest_day(release.getTouZiTs());
		System.out.println("a.getInvest_day()==="+a.getInvest_day());
		// TODO Auto-generated method stub
		return productDao.saveInvest(a);
	}

	@Override
	public List<Product_release> getProductInfo(Integer rows, Integer page,String token) {
		return productDao.getProductInfo(rows,page,token);
	}

	@Override
	public Account getsingProduct(String id) {
		return productDao.getsingProduct(id);
	}

	@Override
	public List<Account> getPouchInfo(Integer state, Integer size, String token) {
		return productDao.getPouchInfo(state,size,token);
	}

	@Override
	public Account getsingPouch(String id) {
		return productDao.getsingPouch(id);
	}

	@Override
	public int updateWith(String id, String withdraw_time) {
		return productDao.updateWith(id,withdraw_time);
	}
	//我的产品提现申请
	public int updateTxian(Account account){
		return productDao.updateTxian(account);
	}
	//提现记录
	public List<WithdrawalRecord> getTxjlInfo(Integer state, Integer size, String token){
		return productDao.getTxjlInfo( state, size,token);
	}
	public WithdrawalRecord getsingRecord(String id){
		return productDao.getsingRecord(id);
	}
	//上传头像
	public int updateTouxiang(String id,String touxiang){
		return productDao.updateTouxiang(id,touxiang);
	}

	//投资记录
	public List<WithdrawalRecord> tzRecordeInfo(Integer state,Integer size,String investor){
		return productDao.tzRecordeInfo( state, size, investor);
	}
	public WithdrawalRecord getsingTzRecord(String id){
		return productDao.getsingTzRecord(id);
	}
}
